﻿using System.Windows;
using System.Windows.Controls;
using Microsoft.VisualStudio.Text.Editor;

namespace Sentio.CodeReview.Editor
{
    /// <summary>
    /// Interaction logic for CodeReviewControlBarUI.xaml
    /// </summary>
    public partial class CodeReviewControlBarUI : UserControl
    {
        private Microsoft.VisualStudio.Text.Editor.IWpfTextViewHost wpfTextViewHost;

        public CodeReviewControlBarUI(Microsoft.VisualStudio.Text.Editor.IWpfTextViewHost wpfTextViewHost)
        {
            InitializeComponent();
            this.wpfTextViewHost = wpfTextViewHost;
        }

        private void ReviewModeSwitch_Click(object sender, RoutedEventArgs e)
        {
            CodeReviewMouseProcessor.ReviewMode = ReviewModeSwitch.IsChecked == true;
            wpfTextViewHost.TextView.ViewScroller.ScrollViewportVerticallyByLine(ScrollDirection.Down);
            wpfTextViewHost.TextView.ViewScroller.ScrollViewportVerticallyByLine(ScrollDirection.Up);
        }
    }
}
